package com.mmy.service.impl.bidtender;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mmy.dao.bidtender.TBidDetailedRepository;
import com.mmy.dao.bidtender.VBidTenderRepository;
import com.mmy.domain.bidtender.TBidDetailed;
import com.mmy.service.ServiceCommon;
import com.mmy.service.bidtender.BidDetailedService;

@Service
public class BidDetailedServiceImpl implements BidDetailedService {
	@Autowired
	TBidDetailedRepository tBidDetailedRepository;
	@Autowired
	ServiceCommon common;
	@Autowired
	VBidTenderRepository vBidTenderRepository;

	/**
	 * 前台个人中心通过投标ID查询投标明细信息
	 *
	 * 前台修改明细耶用到
	 * 
	 * @author 创建人 hanxl 整理
	 * @date 创建日期 2020.10.29
	 */
	public List<TBidDetailed> findByTenderID(String strTenderID) {
		int iTenderID = Integer.parseInt(strTenderID);
		return tBidDetailedRepository.findByTenderID(iTenderID);
	}

	/**
	 * 获得最大编号
	 * 
	 * @return 返回值说明 最大ID
	 * @author 创建人 hanxl
	 * @date 创建日期 2020.12.10
	 */
	public int getMaxDetailedID() {
		// 流水号
		Object objCode = tBidDetailedRepository.getMaxDetailedID();
		int iID = 0;
		if (objCode != null) {
			iID = Integer.parseInt(objCode.toString());
		}
		return iID;
	}

	/**
	 * 通过itenderID删除明细 修改明细功能用到
	 * 
	 * @author 创建人 hanxl
	 * @date 创建日期 2020.12.14
	 */
	public void deleteByTenderID(String strTenderID) {
		int iTenderID = Integer.parseInt(strTenderID);
		tBidDetailedRepository.deleteByTenderID(iTenderID);
	}

}
